﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="采购原料标书录入.aspx.cs" Inherits="syc.Sale.采购原料标书录入" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
 oninserted="SqlDataSource1_Inserted"
 SelectCommand="select @名称=名称,@编号=isnull(编号,''),@年度=年度,@季度=季度,@日期=日期,@备注=isnull(备注,'') from 采购原料标书 where ID=@BillID;"
 InsertCommand="insert into 采购原料标书(名称,编号,年度,季度,日期,备注)values(@名称,@编号,@年度,@季度,@日期,@备注);set @BillID=@@IDENTITY;"
 UpdateCommand="update 采购原料标书 set 名称=@名称,编号=@编号,年度=@年度,季度=@季度,日期=@日期,备注=@备注 where ID=@BillID;" onselected="SqlDataSource1_Selected"
>
<SelectParameters>
<asp:Parameter Name="BillID" DbType="Int32" Size="4" />
<asp:Parameter Name="名称" DbType="String"  Size="60" Direction="Output"/>
<asp:Parameter Name="编号" DbType="AnsiString"  Size="10" Direction="Output"/>
<asp:Parameter Name="年度" DbType="Int32" Size="4" Direction="Output"/>
<asp:Parameter Name="季度" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="日期" DbType="Date"  Size="3" Direction="Output"/>
<asp:Parameter Name="备注" DbType="String"  Size="100" Direction="Output"/>
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="BillID" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="名称" DbType="String"  Size="60"/>
<asp:Parameter Name="编号" DbType="AnsiString"  Size="10"/>
<asp:Parameter Name="年度" DbType="Int32" Size="4" />
<asp:Parameter Name="季度" DbType="Int32" Size="4" />
<asp:Parameter Name="日期" DbType="Date"  Size="3"/>
<asp:Parameter Name="备注" DbType="String"  Size="100"/>
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BillID" DbType="Int32" Size="4"/>
<asp:Parameter Name="名称" DbType="String"  Size="60"/>
<asp:Parameter Name="编号" DbType="AnsiString"  Size="10"/>
<asp:Parameter Name="年度" DbType="Int32" Size="4" />
<asp:Parameter Name="季度" DbType="Int32" Size="4" />
<asp:Parameter Name="日期" DbType="Date"  Size="3"/>
<asp:Parameter Name="备注" DbType="String"  Size="100"/>
</UpdateParameters>
</asp:SqlDataSource>

<asp:Label ID="BillID" runat="server" Text="" Visible="false"></asp:Label>
<div id="wintop" class="wintop" style="display:none;">原料采购标书录入</div>

<asp:Panel ID="Panel1" runat="server" CssClass="panel">
<asp:Button ID="Button_Save" runat="server" Text="保 存" UseSubmitBehavior="false" 
        CssClass="button" onclick="Button_Save_Click" />
        
<asp:Button ID="Button_MX" runat="server" Text="中标明细" UseSubmitBehavior="false"  Visible="false"
        CssClass="button" />
        
<input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel" HorizontalAlign="Center">

<table border="1" style="border-collapse:separate;font-size:14px;margin-bottom:5px;" >
<tr height="30">
<td colspan="4" align="center" style="border:none;font-size:15px;"><b>标 书 基 本 信 息</b></td>
</tr>

<tr height="30">
<td width=90 align="right">名 称<font color=red>*</font>：</td>
<td width=200><asp:TextBox ID="MingCheng" runat="server" Width="160" CssClass="textbox"></asp:TextBox></td>
<td width=90 align="right">编 号：</td>
<td width=200><asp:TextBox ID="BianHao" runat="server" Width="160" CssClass="textbox"></asp:TextBox></td>
</tr>
<tr height="30" >
<td align="right" >年 度：</td>
<td>
<asp:DropDownList
    ID="NianDu" runat="server" Width="100">
    <asp:ListItem Value="2008">2008</asp:ListItem>
    <asp:ListItem Value="2009">2009</asp:ListItem>
    <asp:ListItem Value="2010">2010</asp:ListItem>
    <asp:ListItem Value="2011">2011</asp:ListItem>
    <asp:ListItem Value="2012">2012</asp:ListItem>
    <asp:ListItem Value="2013">2013</asp:ListItem>
    <asp:ListItem Value="2014">2014</asp:ListItem>
    <asp:ListItem Value="2015">2015</asp:ListItem>
    <asp:ListItem Value="2016">2016</asp:ListItem>
    <asp:ListItem Value="2017">2017</asp:ListItem>
    <asp:ListItem Value="2018">2018</asp:ListItem>
    <asp:ListItem Value="2019">2019</asp:ListItem>
    <asp:ListItem Value="2020">2020</asp:ListItem>
    </asp:DropDownList>

</td>
<td align="right">季 度：</td>
<td>
<asp:DropDownList
    ID="JiDu" runat="server" Width="100">
    <asp:ListItem Value="1">1 季度</asp:ListItem>
    <asp:ListItem Value="2">2 季度</asp:ListItem>
    <asp:ListItem Value="3">3 季度</asp:ListItem>
    <asp:ListItem Value="4">4 季度</asp:ListItem>
    </asp:DropDownList>

</td>
</tr>
<tr height="30">
<td align="right">录入日期：</td>
<td><asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="120"></asp:TextBox><img alt="" src="/Icons/29.png" align="absmiddle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" /></td>
<td align="right">备 注：</td>
<td><asp:TextBox ID="BeiZhu" runat="server" Width="200" CssClass="textbox"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>

<asp:Panel ID="Panel_Msg" runat="server" CssClass="panel2">
    <asp:Label ID="Message" runat="server" Text="·" CssClass="prompt"></asp:Label>
</asp:Panel>

</form>

<script >
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }

    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName != "INPUT" || tag.className != "textbox") return;
        if (tag.id == "BeiZhu") return;
        if (e.keyCode == 13) e.keyCode = 9;
    }

    function makecalendar(d, o) {
        obj = o;
        idate = makedate(d);
        cdate = new Date(idate.getFullYear(), idate.getMonth(), 1);
        ds.style.left = "100px";
        ds.style.top = "-6px";
        ds.style.display = 'block';
        showcalendar();
    }
</script>
</body>
</html>
